package o;

import android.content.Context;
import android.os.Build.VERSION;
import android.text.TextUtils;
import android.view.View;
import android.widget.FrameLayout;
import android.widget.ImageView;
import androidx.annotation.DrawableRes;
import com.huawei.appgallery.festivalanimation.particle.modifiers.SizeModifier;
import java.util.Timer;
import java.util.TimerTask;
import o.dky.h;

public abstract class evq extends FrameLayout {
    private Timer ˋ;
    private float ˎ = 0.0f;
    private float ˏ = SizeModifier.STABLE_STATE_SCALE;
    private TimerTask ॱ;

    public abstract void setImage(@DrawableRes int i);

    public abstract void setVideoPlayer(evn o_evn);

    public abstract void ˊ();

    public abstract void ˊ(String str, int i);

    public abstract void ˋ();

    public abstract void ˋ(int i);

    public abstract void ˋ(int i, int i2, String str, String str2);

    public abstract int ˎ(String str);

    public abstract evn ˎ();

    public abstract void ˎ(int i);

    public abstract void ˏ();

    public abstract void ˏ(evp o_evp);

    public abstract ImageView ॱ();

    public abstract void ॱ(long j);

    public abstract void ᐝ();

    public evq(Context context) {
        super(context);
    }

    public void setPlayOutTime(long j) {
    }

    public boolean ʽ() {
        if (ˎ() == null) {
            return true;
        }
        evn ˎ = ˎ();
        if (ˎ.ʾ() && ((!VideoNetChangeDialog.ˊ() && doo.ˊ(getContext())) || (VideoNetChangeDialog.ˎ(getContext()) && !VideoNetChangeDialog.ˏ()))) {
            ˎ.ʻ();
            return true;
        } else if ((VideoNetChangeDialog.ˊ() && VideoNetChangeDialog.ˏ(getContext()) && ˎ.ᐝॱ()) || VideoNetChangeDialog.ˎ(getContext())) {
            return true;
        } else {
            if (!VideoNetChangeDialog.ˊ() && VideoNetChangeDialog.ˏ(getContext())) {
                return true;
            }
            if (ˎ.ʻॱ() || ˎ.ॱˎ()) {
                ˎ.ˊॱ();
            }
            return false;
        }
    }

    public void ˏॱ() {
        ॱˊ();
        if (this.ˋ == null) {
            this.ˋ = new Timer();
        }
        if (this.ॱ == null) {
            this.ॱ = new 4(this);
        }
        this.ˋ.schedule(this.ॱ, 0, 1000);
    }

    public void ॱˊ() {
        if (this.ˋ != null) {
            this.ˋ.cancel();
            this.ˋ = null;
        }
        if (this.ॱ != null) {
            this.ॱ.cancel();
            this.ॱ = null;
        }
    }

    public void setControllerRotation(float f) {
        if (this.ˏ < 0.0f) {
            this.ˏ = getRotation();
        }
        if (((double) Math.abs(f - getRotation())) > 0.001d) {
            int width = getWidth();
            int height = getHeight();
            super.setRotation(f);
            if (f == 0.0f) {
                setTranslationX(0.0f);
                setTranslationY(0.0f);
            } else if (Math.abs(this.ˏ - f) == 180.0f) {
                setTranslationX(0.0f);
                setTranslationY(0.0f);
            } else if (Math.abs(this.ˎ - f) != 180.0f) {
                if (MinimumFactory.getBoolValue(getContext())) {
                    setTranslationX(((float) (height - width)) / 2.0f);
                } else {
                    setTranslationX(((float) (width - height)) / 2.0f);
                }
                setTranslationY(((float) (height - width)) / 2.0f);
            }
            LayoutParams layoutParams = getLayoutParams();
            if (Math.abs(this.ˎ - f) != 180.0f) {
                layoutParams.height = width;
                layoutParams.width = height;
            } else {
                layoutParams.height = height;
                layoutParams.width = width;
            }
            this.ˎ = f;
            if (VERSION.SDK_INT > 23) {
                View findViewById = findViewById(h.ꓸ);
                if (findViewById != null) {
                    findViewById.forceLayout();
                }
            }
            requestLayout();
        }
    }

    public void ˋॱ() {
        super.setRotation(0.0f);
        setTranslationX(0.0f);
        setTranslationY(0.0f);
        LayoutParams layoutParams = getLayoutParams();
        layoutParams.height = -1;
        layoutParams.width = -1;
        requestLayout();
        this.ˎ = 0.0f;
    }

    public void ˋ(ImageView imageView, String str) {
        if (imageView != null) {
            if (TextUtils.isEmpty(str)) {
                imageView.setVisibility(8);
            } else {
                imageView.setVisibility(0);
            }
        }
    }
}
